﻿<Window x:Class="BaffoHat.Wpf.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:BaffoHat.Wpf.Controls"
        Title="BaffoHat Kinect"
		WindowState="Maximized"
                
        DataContext="{Binding Main, Source={StaticResource Locator}}"
		Style="{StaticResource WindowStyle}" >

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        
        <Label Grid.Row="0" Style="{StaticResource HeaderStyle}">BaffoHat Kinect</Label>

        <StackPanel Grid.Row="1" Orientation="Horizontal" >
            <local:KinectButton Command="{Binding AddPlayerCommand}" Style="{StaticResource ButtonStyle}">Add Player</local:KinectButton>
            <local:KinectButton Command="{Binding StartGameCommand}" Style="{StaticResource ButtonStyle}">Start Game</local:KinectButton>
            <local:KinectButton Command="{Binding RollDiceCommand}" Style="{StaticResource ButtonStyle}">Roll Dice</local:KinectButton>
            <local:KinectButton Command="{Binding DrinkCommand}" Style="{StaticResource ButtonStyle}">Drink</local:KinectButton>
        </StackPanel>

        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="400" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <TextBox Grid.Row="0" Grid.Column="0" Height="30" Text="{Binding PlayerName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyle}" />

            <ListBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding Players}" SelectedItem="{Binding SelectedPlayer, Mode=TwoWay}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{Binding Name}" />
                            <Label Content="{Binding GlassesDrink}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Label Grid.Row="0" Grid.Column="1" Content="{Binding DiceFace}" />

        </Grid>

        <ListBox Grid.Row="3" Grid.Column="0" ItemsSource="{Binding Glasses}" Style="{StaticResource ListBoxGlassStyle}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Image Style="{StaticResource GlassStyle}" />
                        <Label Content="{Binding DiceAssociation}" Style="{StaticResource GlassNumberStyle}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <local:KinectCursor x:Name="PART_Cursor"
                            Grid.ColumnSpan="3"
                            Grid.RowSpan="2"
                             />
    </Grid>
</Window>
